package com.hexiang.service.impl;

import com.hexiang.common.PageResult;
import com.hexiang.mapper.MyBatisUserMapper;
import com.hexiang.model.MybatisUser;
import com.hexiang.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 用户实现类
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private MyBatisUserMapper myBatisUserMapper;

    @Override
    public void addUser(MybatisUser mybatisUser) {
        myBatisUserMapper.insert(mybatisUser);
    }

    @Override
    public void updateUser(MybatisUser mybatisUser) {
        myBatisUserMapper.updateById(mybatisUser);
    }

    @Override
    public void deleteUser(String id) {
        myBatisUserMapper.deleteById(id);
    }

    @Override
    public List<MybatisUser> findAll() {
        return myBatisUserMapper.selectList(null);
    }

    @Override
    public MybatisUser findUserById(String id) {
        return myBatisUserMapper.selectById(id);
    }

    @Override
    public List<MybatisUser> findSearch(Map searchMap) {
        return null;
    }

    @Override
    public PageResult<MybatisUser> findSearch(Map searchMap, int page, int size) {
        return null;
    }

    @Override
    public List<MybatisUser> findByXml() {
        return null;
    }

}
